<?php

class digitalcontent extends Controller
{

	 public function index()
    {
    	// Verify if admin is logge in, otherwise redirect out
		Helper::verifyAdminLoggedIn();
		$categories = $this->model->getCategory($category_id);
		// load views
		require APP . 'views/products/index.php';
    }

	public function show($category_id)
    {
    	// Verify if admin is logge in, otherwise redirect out
    	Helper::verifyAdminLoggedIn();
        if (isset($category_id)) {
			// load views
	        // require APP . 'views/admin_templates/header.php';
	        require APP . 'views/categories/Showcategory.php';
			//  require APP . 'views/admin_templates/footer.php';
        } else {
            header('location: ' . URL . 'categories');
        }
    }

	public function viewall($category_id)
    {
    	// Verify if admin is logge in, otherwise redirect out
    	Helper::verifyAdminLoggedIn();
        if (isset($digital_content_id)) {
        	$categories = $this->model->getCategory($category_id);	
			// load views
			// require APP . 'views/admin_templates/header.php';
			// require APP . 'views/digitalContent/Showcontent.php';
			//  require APP . 'views/admin_templates/footer.php';
        }
        header('location: ' . URL . 'categories');
    }
	
}